/*
 * @Author: your name
 * @Date: 2023-09-30 16:41:26
 * @LastEditTime: 2023-11-30 17:15:37
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \Angle\System\SystemSupport\Inc\sys_support_devices.h
 */
/**
 * @file sys_support_devices.h
 * @brief 此文件基于hal库，用于对外公开芯片使用到的外设句柄，并且使用宏来命名，方便
 *        模块层能够hal库初始化完成的外设。
 * @version 0.1
 * @date 2022-12-16
 * 
 * @copyright Copyright (c) 2022
 * 
 */

#ifndef _SYS_SUPPORT_DEVICES_H
#define _SYS_SUPPORT_DEVICES_H

#include "stm32f1xx_hal.h"

// /* 飞控串口 */
// #define UAV_UART_HANDLE	    (&huart1)
// extern UART_HandleTypeDef   huart1;

// /* 光流外设 */
// #define LC307_UART_HANDLE	(&huart2)
// extern UART_HandleTypeDef   huart2;

/* IMU外设 */
#define ICM20602_SPI_HANDLE	(&hspi1)
extern SPI_HandleTypeDef    hspi1;
#define ICM20602_INT_GPIO   GPIOA
#define ICM20602_INT_PIN    GPIO_PIN_1
#define ICM20602_NSS_GPIO   GPIOA
#define ICM20602_NSS_PIN    GPIO_PIN_4

/* IMU方向修正 */
#define IMU_DIRECTION       "+X+Y+Z"    

// /* 激光测距外设 */
// #define VL53L1X_I2C_HANDLE  (&hi2c1)
// extern I2C_HandleTypeDef    hi2c1;

/* 磁力计外设 */
#define LSM303D_SPI_HANDLE  (&hspi1)
extern SPI_HandleTypeDef    hspi1;
#define LSM303D_NSS_GPIO    GPIOA
#define LSM303D_NSS_PIN     GPIO_PIN_3

/* 磁力计方向修正 */
#define MAG_DIRECTION       "+X+Y+Z"

/* 指示灯外设 */
#define INDICATOR_LED_WHITE_GPIO            0
#define INDICATOR_LED_RED_GPIO              0
#define INDICATOR_LED_GREEN_GPIO            GPIOA
#define INDICATOR_LED_BLUE_GPIO             0
#define INDICATOR_LED_YELLOW_GPIO           0

#define INDICATOR_LED_WHITE_GPIO_PIN        0
#define INDICATOR_LED_RED_GPIO_PIN          0
#define INDICATOR_LED_GREEN_GPIO_PIN        GPIO_PIN_8
#define INDICATOR_LED_BLUE_GPIO_PIN         0
#define INDICATOR_LED_YELLOW_GPIO_PIN       0




#endif /* _SYS_SUPPORT_DEVICES_H */
